The IDLffDicomExStorScu::Send function method transfers DICOM files to a remote Storage SCP node.
The STORAGE_SCP property must contain the name of a valid Application Entity that supports the Storage SCP service in order for the Send method to succeed. All to other properties used by the Send method have usable default values.
If the CALLBACK_FUNCTION property contains the name of an IDL function, that function is called each time a DICOM file is sent to the remote node. The function is called with an array of strings containing status information about the send operation as its first parameter. See Using Callbacks With the IDLffDicomExStorScu Object for a discussion of callback functions.
To cancel a send operation before all files are transferred, the callback function specified by the CALLBACK_FUNCTION property must return zero.
Result = Obj->[IDLffDicomExStorScu::]Send(Files)
This method returns the number of DICOM files that were successfully sent.
A scalar string or string array containing the fully qualified paths of the DICOM files to be transferred to the remote Storage SCP node.
None
The following example code shows how to programmatically configure a local Storage SCP, create a local Storage SCU Application Entity, and transfer files to the Storage SCP.
To run the example, do the following:
stor_scu_send_files.pro.stor_scu_send_files.pro in IDL.PRO stor_scu_send_files
; Update the local user configuration file.
; Note that in a production application, you would probably
; not need to update the configuration file each time the
; application runs.
;
; First create a new local user configuration object.
ocfg = OBJ_NEW('IDLffDicomExCfg')
; Add the local IDL Storage SCP Application Entity to the
; local configuration file. Note that 'my_stor_scp' must be
; configured on the remote query/retrieve SCP node.
ocfg->SetApplicationEntity, 'my_stor_scp_aen', $
'my_stor_scp', 'localhost', 2510, $
'Storage_SCP_Service_List', 'Storage_SCP'
ocfg->SetValue, 'StorScpServiceAE', 'my_stor_scp_aen'
; Save the changes to the configuration file.
ocfg->Commit
; Destroy the configuration file object.
OBJ_DESTROY, ocfg
; Update the system configuration file.
; Note that in a production application, you would probably
; not need to update the configuration file each time the
; application runs.
;
; First create a new system configuration object.
ocfg = OBJ_NEW('IDLffDicomExCfg', /SYSTEM)
; Add the Storage SCP Application Entity to the system
; configuration file. Note that 'my_stor_scp' must be
; configured on the remote query/retrieve SCP node.
ocfg->SetApplicationEntity, 'my_stor_scp_aen', $
'my_stor_scp', 'localhost', 2510, $ 'Storage_SCP_Service_List', 'Storage_SCP'
ocfg->SetValue, 'StorScpServiceAE', 'my_stor_scp_aen'
; Set the Storage SCP directory to the temporary directory.
tmpDir = FILEPATH('', /TMP)
ocfg->SetValue, 'StorScpDir', tmpDir
PRINT, 'stor scp dir = ', tmpDir
; Save the changes to the configuration file.
ocfg->Commit
; Stop and restart the Storage SCP Service. Restarting is
; necessary because we have changed the Storage SCP configuration.
status = ocfg->StorageScpService('stop')
PRINT, 'Stopping Storage SCP. Status: ', status
WAIT, 5
status = ocfg->StorageScpService('start')
PRINT, 'Starting Storage SCP. Status: ', status
WAIT, 5
; Destroy the configuration file object.
OBJ_DESTROY, ocfg
; Select a file to transfer to the Storeage SCP.
srcfn1 = FILEPATH('mr_brain.dcm',SUBDIR=['examples', 'data'])
; Create a new Storage SCU object and associate the Storage SCP.
oss = OBJ_NEW('IDLffDicomExStorScu')
oss->SetProperty, STORAGE_SCP = 'my_stor_scp_aen'
; Transfer the file to the Storage SCP
cnt = oss->Send(srcfn1)
; Report the number of files transferred.
PRINT, 'Number of files transferred: ', cnt
; Destroy the Storage SCU object.
OBJ_DESTROY, oss
END
|
6.3 |
Introduced |